import type { postOrPutType } from "@/constants";
import type { HasId, IResult } from "@/types/common";
import { getAxios, commonAxiosJson, deleteAxios } from "@/utils/request.ts";
/* 商学院主体 地址 */
const url = "/back/business-school-entity";
/* 获取 商学院主体信息 */
export const getBusinessSchoolEntityInfo = <T, D>(params?: D): Promise<IResult<T>> => {
  return getAxios<T, D>(url, params);
};
/* 获取 商学院主体详情信息 */
export const getBusinessSchoolEntityByIdInfo = <T, D extends HasId>(params: D): Promise<IResult<T>> => {
  return getAxios<T, D>(url + "/" + params.id, params);
};
/* 新增，修改商学院主体信息 */
export const commonBusinessSchoolEntityInfo = <T, D>(params: D, type: postOrPutType): Promise<IResult<T>> => {
  return commonAxiosJson<T, D>(url, params, type);
};

/* 删除 商学院主体信息 */
export const deleteBusinessSchoolEntityInfo = <T, D>(params: D): Promise<IResult<T>> => {
  return deleteAxios<T, D>(url, params);
};
